home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group03a.txt
/
000033_icon-group-sender_Wed Mar 12 12:35:15 2003.msg
< prev
next >
Wrap
Internet Message Format
|
2003-12-22
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2CJX6c03437
for icon-group-addresses; Wed, 12 Mar 2003 12:33:06 -0700 (MST)
Message-Id: <200303121933.h2CJX6c03437@baskerville.CS.Arizona.EDU>
X-Authentication-Warning: weaver.tuc.noao.edu: swampler set sender to swampler@noao.edu using -f
Subject: Re: Sorting lists
From: Steve Wampler <swampler@noao.edu>
To: rjhare@ed.ac.uk
Cc: icon-group@cs.arizona.edu
Date: 12 Mar 2003 08:51:45 -0700
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
On Wed, 2003-03-12 at 07:21, rjhare@ed.ac.uk wrote:
> I don't have the book to hand and am sitting in an Icon-free zone at
> the moment. What do I get if I sort a list of lists like this:
>
> [ [b,c], [a,d] ]
>
> I hope I get:
>
> [ [a,d], [b,c]]
>
> but fear that I might get:
>
> [ a, b, c, d]
>
> Thanks.
>
> Roger Hare
To make sure I understand, you have (say)
a := [ ["b","c"], ["a","d"] ]
and want to know the result of sort(a), right?
The answer is that you won't get [ "a", "b", "c", "d" ],
but you probably will not get [ ["a","d"], ["b", "c"] ], either.
When sorting a list of structures (what you have), the
sorting order is by time of creation of those structures.
Icon won't look 'inside' those structures to see what they
contain. So, since ["b","c"] was created before ["a","d"]
in the above example, I would expect the result of the
sort to be [ ["b","c"], ["a","d"] ].
Hope that helps!
--
Steve Wampler <swampler@noao.edu>
National Solar Observatory